package tictactoe.game;


public class Model
{
       
        private int[][] grid;
        private final int X, Y;
        private int scoreX = 0, scoreY = 0;
        private int round = 1;
       
        public Model(int x, int y) {
                grid = new int[x][y];
                int counter = 0;
                for(int i=0;i<x;i++)
                   for(int j=0;j<y;j++)
                           grid[i][j] = (--counter);
                this.X = x;
                this.Y = y;
        }
        public int[][] getGrid() {
                return grid;
        }
       
        public int getX() {
                return X;
        }
       
        public int getY() {
                return Y;
        }

    public int getRound()
    {
        return round;
    }

    public void setRound(int round)
    {
        this.round = round;
    }

    public int getScoreX()
    {
        return scoreX;
    }

    public void setScoreX(int scoreX)
    {
        this.scoreX = scoreX;
    }

    public int getScoreY()
    {
        return scoreY;
    }

    public void setScoreY(int scoreY)
    {
        this.scoreY = scoreY;
    }

        public void increaseRound()
        {
            round++;
        }
        
        public void increaseScoreX()
        {
            scoreX++;
        }
        
        public void increaseScoreY()
        {
            scoreY++;
        }    
       
       public void clear()
       {
           int counter = 0;
           for (int i = 0; i < X; i++)
               for (int j = 0; j < Y; j++)
                   grid[i][j] = (--counter);
       }
}